package java网络编程;

import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;

/**
 * @author coderFu
 * @create 2022/2/25
 * TCP链接的客户端
 */
public class ClientTCP {

    public static void main(String[] args) throws IOException {

        Socket client = new Socket("localhost",8088);

        Scanner scanner = new Scanner(client.getInputStream());

        while (scanner.hasNextLine()){
            String line = scanner.nextLine();

            System.out.println("这里是客户端： "+line);
        }
        scanner.close();
        client.close();
    }
}
